/**
 * 
 */
package server.connection.listening;

import java.nio.channels.SocketChannel;

/**
 * Wrapps infomation about connection. 
 * Used to transfer connection data between Main selector and SelectorThread
 * 
 * @author Kamil Nowak 
 * 
 */
public class SocketChannelDTO {

	private Long connectionID;
	private SocketChannel channel;
	
	/**
	 * Creates new SocketChannel transfer object 
	 * 
	 * @param id unique connection id
	 * @param channel connection's channel
	 */
	public SocketChannelDTO(Long id,SocketChannel channel) {
		this.channel = channel;
		this.connectionID = id;
	}

	public SocketChannel getSocketChannel() {
		return channel;
	}

	public Long getConnectionID() {
		return connectionID;
	}

	
	public String toString() {
	
		return (new StringBuilder("SocketChannelDTO: ")).append(" connectionID: ").append(connectionID)
									.append(" channel: ").append(channel.toString()).toString();
	}
	
	
	
	
}
